package com.ithinkstudio.jeez.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @program: springboot-mybatis-jpa
 * @description: 用户实体
 * @author: fengzp
 * @create: 2020/04/14
 */
@Data
@Entity
@Table(name = "t_user")
@Accessors(chain = true)
public class User implements Serializable {

    /**
     * 主键ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 账号
     */
    @Column(nullable = false)
    private String username;
    /**
     * 名字
     */
    @Column
    private String name;
    /**
     * 密码
     */
    @Column
    private String password;
    /**
     * md5密码盐
     */
    @Column
    private String salt;
    /**
     * 联系电话
     */
    @Column
    private String phone;
    /**
     * 备注
     */
    @Column
    private String tips;
    /**
     * 状态 1:正常 2:禁用
     */
    @Column
    private Integer state;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "created_time")
    private Date createdTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "updated_time")
    private Date updatedTime;
}
